<? FoundryView::includeTpl( 'adminMain:header' ) ?>

<div id="mainContent">


	<h2>Groups</h2>
	
	<a href="<?=FoundryView::helperLinkTo( 'userAdmin/editGroup' )?>" class="actionLink">
		<img src="<?=Foundry::config('webpath')?>/images/admin/add.png" />
		new group</a>
	
	<div class="actionForm">
		<form method="post" action="<?=FoundryView::helperLinkTo('userAdmin/editGroup')?>/<?=$this->data['group']->uid?>">

		<div class="cellLeft">
	
			<input type="hidden" name="k" value="<?=$this->data['key']?>" />
			<label for="groupName">Name</label>
			<input type="text" name="groupName" value="<?=$this->data['group']->name?>" /><p />

			<label for="groupRole">Role</label>
			<select name="groupRole[]" multiple="true">
			<?php
				foreach( $this->data['modules'] as $key => $mod ) {
					echo '<option value="'.$key.'"';
					if( is_array( $this->data['group']->role ) ) {
						if( in_array( $key, $this->data['group']->role ) ) {
							echo ' selected="selected"';
						}
					}
					echo '>'.$this->data['mask'][$key].'</option>';
				}
			?>
			</select><p />

			<input type="submit" value="Save" />
			<a href="<?=FoundryView::helperLinkTo( 'userAdmin/' )?>" class="cancelLink">
				Cancel</a>
		</div>
		<div class="cellRight">

			

		</div>
		<br class="cellBottom" />
		
		</form>
	</div>	
	
</div>

<? FoundryView::includeTpl( 'adminMain:footer' ) ?>